The present invention relates to implementing an add program counter immediate shift (ADDPCIS) instruction and, more specifically, to methods of implementing an ADDPCIS instruction in a legacy system using a micro-coded or cracked sequence.
A program counter (PC) in a computing device is a processor register that indicates where the computing device is in its program sequence. In most processors, the PC is incremented after fetching an instruction and holds the memory address of (“points to”) the next instruction that would be executed (by contrast, in a processor where incrementing precedes fetching, the PC points to a current instruction being executed). Instructions are usually fetched sequentially from memory but control transfer instructions often change the sequence by placing a new value in the PC. These include branches (sometimes called jumps), subroutine calls and returns. A transfer instruction that is conditional on the truth of some assertion lets the computer follow a different sequence under different conditions. A branch instruction provides that the next instruction is fetched from somewhere else in memory. A subroutine call not only branches but saves the preceding contents of the PC somewhere. A return retrieves the saved contents of the PC and places it back in the PC, resuming sequential execution with the instruction following the subroutine call.
A program counter in a z/Architecture® processor is generally 64 bits and can be truncated to 31 or 24 bits to support prior addressing limits. The program counter is typically embodied in a program status word (PSW) such that it persists during context switching. Thus, a program in progress, having a program counter value, may be interrupted by, for example, the operating system in an exemplary context switch from a program environment to an operating system environment. The PSW of the program maintains the program counter value while the program is not active and the program counter (in the PSW) of the operating system is used while the operating system is executing. Typically, the program counter is incremented by an amount equal to the number of bytes of a current instruction.